Repository navigation
IAM: preserve case-sensitive managed-policy tag keys - #10550
Open
narayana006 wants to merge 1 commit into
Open
narayana006 wants to merge 1 commit into
narayana006 wants to merge 1 commit into
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
IAM: preserve case-sensitive managed-policy tag keys
Managed policy tags incorrectly share the case-insensitive normalization used for users and roles. CreatePolicy rejects Costcenter and costcenter together, TagPolicy overwrites a differently cased key, and UntagPolicy can remove the wrong tag.
Allow tag validation to preserve exact keys for managed policies. Keep the existing default for users and roles, and remove only an exact policy tag key. Regression tests cover creation, updates, and removal. Replace two old negative tests whose case-insensitive policy-tag expectation contradicts AWS's documented contract; exact duplicate-key rejection remains covered.
Expected behavior follows AWS's IAM tag case-sensitivity documentation.
Validation: all three new regressions fail before the fix. All 388 IAM tests pass with the fix, including existing role-tag tests. Repository-wide Ruff checks and formatting, targeted mypy for moto/iam/models.py, and git diff --check pass. No real AWS verification or full-project mypy is claimed. Other IAM resource types using the same helper are outside this scoped managed-policy proposal.
Prepared with OpenAI Codex assistance.